{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "30097eab",
   "metadata": {},
   "outputs": [],
   "source": [
    "from IPython.core.interactiveshell import InteractiveShell\n",
    "InteractiveShell.ast_node_interactivity = 'all'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "ed94181a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "from pyecharts import charts as ch\n",
    "from pyecharts import options as opts\n",
    "from pyecharts.globals import ThemeType\n",
    "from pyecharts.commons.utils import JsCode"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "08bce462",
   "metadata": {},
   "source": [
    "导入四个表数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b4fe75e2",
   "metadata": {},
   "outputs": [],
   "source": [
    "WatchTime = pd.read_excel(\"../Data/星光盛典数据.xlsx\",sheet_name=\"WatchTime\",index_col=\"WatchTime\")\n",
    "GeoArea = pd.read_excel(\"../Data/星光盛典数据.xlsx\",sheet_name=\"GeoArea\",index_col=\"GeoArea\")\n",
    "Gender = pd.read_excel(\"../Data/星光盛典数据.xlsx\",sheet_name=\"Gender\",index_col=\"Gender\")\n",
    "Device = pd.read_excel(\"../Data/星光盛典数据.xlsx\",sheet_name=\"Device\",index_col=\"Device\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3e1f3ea5",
   "metadata": {},
   "source": [
    "# 观看时间可视化"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "a6831c43",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"223942f191e449bc8915a84f55931676\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_223942f191e449bc8915a84f55931676 = echarts.init(\n",
       "                    document.getElementById('223942f191e449bc8915a84f55931676'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_223942f191e449bc8915a84f55931676 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u76f4\\u64ad\",\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                2990,\n",
       "                536,\n",
       "                472,\n",
       "                199,\n",
       "                192\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"bar\",\n",
       "            \"name\": \"\\u56de\\u653e\",\n",
       "            \"yAxisIndex\": 1,\n",
       "            \"legendHoverLink\": true,\n",
       "            \"data\": [\n",
       "                153,\n",
       "                14,\n",
       "                14,\n",
       "                4,\n",
       "                9\n",
       "            ],\n",
       "            \"showBackground\": false,\n",
       "            \"barMinHeight\": 0,\n",
       "            \"barCategoryGap\": \"20%\",\n",
       "            \"barGap\": \"30%\",\n",
       "            \"large\": false,\n",
       "            \"largeThreshold\": 400,\n",
       "            \"seriesLayoutBy\": \"column\",\n",
       "            \"datasetIndex\": 0,\n",
       "            \"clip\": true,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u76f4\\u64ad\",\n",
       "                \"\\u56de\\u653e\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u76f4\\u64ad\": true,\n",
       "                \"\\u56de\\u653e\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"axis\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"xAxis\": [\n",
       "        {\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            },\n",
       "            \"data\": [\n",
       "                \"0~5min\",\n",
       "                \"5~10min\",\n",
       "                \"10~30min\",\n",
       "                \"30~60min\",\n",
       "                \"60~min\"\n",
       "            ]\n",
       "        }\n",
       "    ],\n",
       "    \"yAxis\": [\n",
       "        {\n",
       "            \"type\": \"value\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"max\": 3200,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        },\n",
       "        {\n",
       "            \"name\": \"\\u56de\\u653e\",\n",
       "            \"show\": true,\n",
       "            \"scale\": false,\n",
       "            \"nameLocation\": \"end\",\n",
       "            \"nameGap\": 15,\n",
       "            \"gridIndex\": 0,\n",
       "            \"axisTick\": {\n",
       "                \"show\": true,\n",
       "                \"alignWithLabel\": false,\n",
       "                \"inside\": false\n",
       "            },\n",
       "            \"inverse\": false,\n",
       "            \"offset\": 0,\n",
       "            \"splitNumber\": 5,\n",
       "            \"max\": 180,\n",
       "            \"minInterval\": 0,\n",
       "            \"splitLine\": {\n",
       "                \"show\": false,\n",
       "                \"lineStyle\": {\n",
       "                    \"show\": true,\n",
       "                    \"width\": 1,\n",
       "                    \"opacity\": 1,\n",
       "                    \"curveness\": 0,\n",
       "                    \"type\": \"solid\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u67f1\\u72b6\\u56fe\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"toolbox\": {\n",
       "        \"show\": false,\n",
       "        \"orient\": \"horizontal\",\n",
       "        \"itemSize\": 15,\n",
       "        \"itemGap\": 10,\n",
       "        \"left\": \"80%\",\n",
       "        \"feature\": {\n",
       "            \"saveAsImage\": {\n",
       "                \"type\": \"png\",\n",
       "                \"backgroundColor\": \"auto\",\n",
       "                \"connectedBackgroundColor\": \"#fff\",\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u4fdd\\u5b58\\u4e3a\\u56fe\\u7247\",\n",
       "                \"pixelRatio\": 1\n",
       "            },\n",
       "            \"restore\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u8fd8\\u539f\"\n",
       "            },\n",
       "            \"dataView\": {\n",
       "                \"show\": true,\n",
       "                \"title\": \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                \"readOnly\": false,\n",
       "                \"lang\": [\n",
       "                    \"\\u6570\\u636e\\u89c6\\u56fe\",\n",
       "                    \"\\u5173\\u95ed\",\n",
       "                    \"\\u5237\\u65b0\"\n",
       "                ],\n",
       "                \"backgroundColor\": \"#fff\",\n",
       "                \"textareaColor\": \"#fff\",\n",
       "                \"textareaBorderColor\": \"#333\",\n",
       "                \"textColor\": \"#000\",\n",
       "                \"buttonColor\": \"#c23531\",\n",
       "                \"buttonTextColor\": \"#fff\"\n",
       "            },\n",
       "            \"dataZoom\": {\n",
       "                \"show\": true,\n",
       "                \"title\": {\n",
       "                    \"zoom\": \"\\u533a\\u57df\\u7f29\\u653e\",\n",
       "                    \"back\": \"\\u533a\\u57df\\u7f29\\u653e\\u8fd8\\u539f\"\n",
       "                },\n",
       "                \"icon\": {},\n",
       "                \"xAxisIndex\": false,\n",
       "                \"yAxisIndex\": false,\n",
       "                \"filterMode\": \"filter\"\n",
       "            },\n",
       "            \"magicType\": {\n",
       "                \"show\": true,\n",
       "                \"type\": [\n",
       "                    \"line\",\n",
       "                    \"bar\",\n",
       "                    \"stack\",\n",
       "                    \"tiled\"\n",
       "                ],\n",
       "                \"title\": {\n",
       "                    \"line\": \"\\u5207\\u6362\\u4e3a\\u6298\\u7ebf\\u56fe\",\n",
       "                    \"bar\": \"\\u5207\\u6362\\u4e3a\\u67f1\\u72b6\\u56fe\",\n",
       "                    \"stack\": \"\\u5207\\u6362\\u4e3a\\u5806\\u53e0\",\n",
       "                    \"tiled\": \"\\u5207\\u6362\\u4e3a\\u5e73\\u94fa\"\n",
       "                },\n",
       "                \"icon\": {}\n",
       "            },\n",
       "            \"brush\": {\n",
       "                \"icon\": {},\n",
       "                \"title\": {\n",
       "                    \"rect\": \"\\u77e9\\u5f62\\u9009\\u62e9\",\n",
       "                    \"polygon\": \"\\u5708\\u9009\",\n",
       "                    \"lineX\": \"\\u6a2a\\u5411\\u9009\\u62e9\",\n",
       "                    \"lineY\": \"\\u7eb5\\u5411\\u9009\\u62e9\",\n",
       "                    \"keep\": \"\\u4fdd\\u6301\\u9009\\u62e9\",\n",
       "                    \"clear\": \"\\u6e05\\u9664\\u9009\\u62e9\"\n",
       "                }\n",
       "            }\n",
       "        }\n",
       "    }\n",
       "};\n",
       "                chart_223942f191e449bc8915a84f55931676.setOption(option_223942f191e449bc8915a84f55931676);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae568ea90>"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Bar(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add_xaxis(WatchTime.index.to_list())\n",
    "    .add_yaxis('直播',WatchTime.Live.to_list(),label_opts=opts.LabelOpts(is_show=True))\n",
    "    .add_yaxis('回放',WatchTime.Replay.to_list(),yaxis_index=1,label_opts=opts.LabelOpts(is_show=True))\n",
    "    .extend_axis( \n",
    "        yaxis=opts.AxisOpts(\n",
    "            name='回放',\n",
    "            max_=180,\n",
    "            axistick_opts=opts.AxisTickOpts(is_show=True)\n",
    "        )\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(title=\"观看时长统计柱状图\"),\n",
    "        tooltip_opts=opts.TooltipOpts(trigger=\"axis\"),\n",
    "        toolbox_opts=opts.ToolboxOpts(is_show=False),\n",
    "    \n",
    "        yaxis_opts=opts.AxisOpts(\n",
    "            type_=\"value\",\n",
    "            max_=3200,\n",
    "            splitline_opts=opts.SplitLineOpts(is_show=False)            \n",
    "        ),\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "4646c51a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"0f616cb4567d488f86615aa990ae3d54\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_0f616cb4567d488f86615aa990ae3d54 = echarts.init(\n",
       "                    document.getElementById('0f616cb4567d488f86615aa990ae3d54'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_0f616cb4567d488f86615aa990ae3d54 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u76f4\\u64ad\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"0~5min\",\n",
       "                    \"value\": 2990\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5~10min\",\n",
       "                    \"value\": 536\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"10~30min\",\n",
       "                    \"value\": 472\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30~60min\",\n",
       "                    \"value\": 199\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"60~min\",\n",
       "                    \"value\": 192\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"0~5min\",\n",
       "                \"5~10min\",\n",
       "                \"10~30min\",\n",
       "                \"30~60min\",\n",
       "                \"60~min\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u5360\\u6bd4\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_0f616cb4567d488f86615aa990ae3d54.setOption(option_0f616cb4567d488f86615aa990ae3d54);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aacb14c198>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"直播观看时长统计饼状图\",[list(z) for z in zip(WatchTime.index.tolist(),WatchTime.Live.tolist())],radius=[\"40%\", \"80%\"])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"观看时长统计占比\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "36463372",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"1657e6b884da41a7bf84f1424f9298f8\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_1657e6b884da41a7bf84f1424f9298f8 = echarts.init(\n",
       "                    document.getElementById('1657e6b884da41a7bf84f1424f9298f8'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_1657e6b884da41a7bf84f1424f9298f8 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"0~5min\",\n",
       "                    \"value\": 153\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"5~10min\",\n",
       "                    \"value\": 14\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"10~30min\",\n",
       "                    \"value\": 14\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"30~60min\",\n",
       "                    \"value\": 4\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"60~min\",\n",
       "                    \"value\": 9\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"0~5min\",\n",
       "                \"5~10min\",\n",
       "                \"10~30min\",\n",
       "                \"30~60min\",\n",
       "                \"60~min\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u5360\\u6bd4\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_1657e6b884da41a7bf84f1424f9298f8.setOption(option_1657e6b884da41a7bf84f1424f9298f8);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae56b82e8>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"回放观看时长统计饼状图\",[list(z) for z in zip(WatchTime.index.tolist(),WatchTime.Replay.tolist())],radius=[\"40%\", \"80%\"])\n",
    "    .set_global_opts(title_opts=opts.TitleOpts(title=\"回放观看时长统计占比\"))\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "fcd5ea67",
   "metadata": {},
   "source": [
    "# 观看人数地区分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "1579657c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'china':'https://assets.pyecharts.org/assets/maps/china', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"816056d6ec004a4b839c0b9dc1ec464f\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'china', 'macarons'], function(echarts) {\n",
       "                var chart_816056d6ec004a4b839c0b9dc1ec464f = echarts.init(\n",
       "                    document.getElementById('816056d6ec004a4b839c0b9dc1ec464f'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_816056d6ec004a4b839c0b9dc1ec464f = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"map\",\n",
       "            \"name\": \"\\u89c2\\u770b\\u4eba\\u6570\\u5206\\u5e03\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"mapType\": \"china\",\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u6c5f\\u897f\",\n",
       "                    \"value\": [\n",
       "                        866\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5e7f\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        745\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u4e1c\",\n",
       "                    \"value\": [\n",
       "                        579\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5357\",\n",
       "                    \"value\": [\n",
       "                        492\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5317\\u4eac\",\n",
       "                    \"value\": [\n",
       "                        449\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5c71\\u897f\",\n",
       "                    \"value\": [\n",
       "                        389\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u56db\\u5ddd\",\n",
       "                    \"value\": [\n",
       "                        385\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5fbd\",\n",
       "                    \"value\": [\n",
       "                        367\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6cb3\\u5317\",\n",
       "                    \"value\": [\n",
       "                        363\n",
       "                    ]\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u6e56\\u5317\",\n",
       "                    \"value\": [\n",
       "                        332\n",
       "                    ]\n",
       "                }\n",
       "            ],\n",
       "            \"roam\": true,\n",
       "            \"aspectScale\": 0.75,\n",
       "            \"nameProperty\": \"name\",\n",
       "            \"selectedMode\": false,\n",
       "            \"zoom\": 1,\n",
       "            \"mapValueCalculation\": \"sum\",\n",
       "            \"showLegendSymbol\": true,\n",
       "            \"emphasis\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u89c2\\u770b\\u4eba\\u6570\\u5206\\u5e03\"\n",
       "            ],\n",
       "            \"selected\": {\n",
       "                \"\\u89c2\\u770b\\u4eba\\u6570\\u5206\\u5e03\": true\n",
       "            },\n",
       "            \"show\": true,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ],\n",
       "    \"visualMap\": {\n",
       "        \"show\": true,\n",
       "        \"type\": \"piecewise\",\n",
       "        \"min\": 0,\n",
       "        \"max\": 1000,\n",
       "        \"inRange\": {\n",
       "            \"color\": [\n",
       "                \"#CCEBFF\",\n",
       "                \"#22DDDD\",\n",
       "                \"#0099FF\",\n",
       "                \"#003D66\"\n",
       "            ]\n",
       "        },\n",
       "        \"calculable\": true,\n",
       "        \"inverse\": false,\n",
       "        \"splitNumber\": 5,\n",
       "        \"orient\": \"vertical\",\n",
       "        \"showLabel\": true,\n",
       "        \"itemWidth\": 20,\n",
       "        \"itemHeight\": 14,\n",
       "        \"borderWidth\": 0\n",
       "    }\n",
       "};\n",
       "                chart_816056d6ec004a4b839c0b9dc1ec464f.setOption(option_816056d6ec004a4b839c0b9dc1ec464f);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae5e01160>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Map(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"观看人数分布\", [list(z) for z in zip(GeoArea.index, GeoArea.values.tolist())], \"china\")\n",
    "    .set_global_opts(\n",
    "        visualmap_opts=opts.VisualMapOpts(max_=1000,is_piecewise=True,type_='color',range_color = ['#CCEBFF','#22DDDD','#0099FF','#003D66'],)\n",
    "    )\n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "16c0775b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[866],\n",
       "       [745],\n",
       "       [579],\n",
       "       [492],\n",
       "       [449],\n",
       "       [389],\n",
       "       [385],\n",
       "       [367],\n",
       "       [363],\n",
       "       [332]], dtype=int64)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "GeoArea.values"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a5c8aee7",
   "metadata": {},
   "source": [
    "# 性别分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "02978da5",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"fd581571b5494181a6ea424262a90ff7\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_fd581571b5494181a6ea424262a90ff7 = echarts.init(\n",
       "                    document.getElementById('fd581571b5494181a6ea424262a90ff7'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_fd581571b5494181a6ea424262a90ff7 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u7537\\u6027\",\n",
       "                    \"value\": 2483\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5973\\u6027\",\n",
       "                    \"value\": 1522\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u672a\\u77e5\",\n",
       "                    \"value\": 963\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u7537\\u6027\",\n",
       "                \"\\u5973\\u6027\",\n",
       "                \"\\u672a\\u77e5\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_fd581571b5494181a6ea424262a90ff7.setOption(option_fd581571b5494181a6ea424262a90ff7);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae5dac908>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"回放观看时长统计饼状图\",[list(z) for z in zip(Gender.index.tolist(),Gender.Users.tolist())],radius=[\"40%\", \"80%\"])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "de79a220",
   "metadata": {},
   "source": [
    "# 设备分析"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "8cf6ae67",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'macarons':'https://assets.pyecharts.org/assets/themes/macarons'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"e6f58d4b9ba24406b5fb8a5d5704ed4a\" style=\"width:1000px; height:600px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'macarons'], function(echarts) {\n",
       "                var chart_e6f58d4b9ba24406b5fb8a5d5704ed4a = echarts.init(\n",
       "                    document.getElementById('e6f58d4b9ba24406b5fb8a5d5704ed4a'), 'macarons', {renderer: 'canvas'});\n",
       "                var option_e6f58d4b9ba24406b5fb8a5d5704ed4a = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"\\u56de\\u653e\\u89c2\\u770b\\u65f6\\u957f\\u7edf\\u8ba1\\u997c\\u72b6\\u56fe\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"\\u5b89\\u5353\\u624b\\u673a\",\n",
       "                    \"value\": 3923\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u82f9\\u679c\\u624b\\u673a\",\n",
       "                    \"value\": 833\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"\\u5176\\u4ed6\",\n",
       "                    \"value\": 211\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": [\n",
       "                \"40%\",\n",
       "                \"80%\"\n",
       "            ],\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"margin\": 8,\n",
       "                \"formatter\": \"{b}: {d}%\"\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"\\u5b89\\u5353\\u624b\\u673a\",\n",
       "                \"\\u82f9\\u679c\\u624b\\u673a\",\n",
       "                \"\\u5176\\u4ed6\"\n",
       "            ],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    }\n",
       "};\n",
       "                chart_e6f58d4b9ba24406b5fb8a5d5704ed4a.setOption(option_e6f58d4b9ba24406b5fb8a5d5704ed4a);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae5e01fd0>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(\n",
    "    ch.Pie(init_opts=opts.InitOpts(width=\"1000px\", height=\"600px\",theme=ThemeType.MACARONS))\n",
    "    .add(\"回放观看时长统计饼状图\",[list(z) for z in zip(Device.index.tolist(),Device.Users.tolist())],radius=[\"40%\", \"80%\"])\n",
    "    .set_series_opts(label_opts=opts.LabelOpts(formatter=\"{b}: {d}%\"))\n",
    "    \n",
    "    .render_notebook()\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "e2ba6477",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min', 'echarts-liquidfill':'https://assets.pyecharts.org/assets/echarts-liquidfill.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"2b1cf1b83f99463e882d327c49d97a51\" style=\"width:900px; height:500px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts', 'echarts-liquidfill'], function(echarts) {\n",
       "                var chart_2b1cf1b83f99463e882d327c49d97a51 = echarts.init(\n",
       "                    document.getElementById('2b1cf1b83f99463e882d327c49d97a51'), 'white', {renderer: 'canvas'});\n",
       "                var option_2b1cf1b83f99463e882d327c49d97a51 = {\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"liquidFill\",\n",
       "            \"name\": \"lq\",\n",
       "            \"data\": [\n",
       "                0.7898\n",
       "            ],\n",
       "            \"waveAnimation\": true,\n",
       "            \"animationDuration\": 2000,\n",
       "            \"animationDurationUpdate\": 1000,\n",
       "            \"color\": [\n",
       "                \"#2ec7c9\"\n",
       "            ],\n",
       "            \"shape\": \"circle\",\n",
       "            \"backgroundStyle\": {},\n",
       "            \"outline\": {\n",
       "                \"show\": true,\n",
       "                \"borderDistance\": 8\n",
       "            },\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"inside\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 50,\n",
       "                \"formatter\": function (param) {                    return (Math.floor(param.value * 10000) / 100) + '%';                }\n",
       "            },\n",
       "            \"center\": [\n",
       "                \"60%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"xAxisIndex\": 0,\n",
       "            \"yAxisIndex\": 0\n",
       "        },\n",
       "        {\n",
       "            \"type\": \"liquidFill\",\n",
       "            \"name\": \"lq\",\n",
       "            \"data\": [\n",
       "                0.0425\n",
       "            ],\n",
       "            \"waveAnimation\": true,\n",
       "            \"animationDuration\": 2000,\n",
       "            \"animationDurationUpdate\": 1000,\n",
       "            \"color\": [\n",
       "                \"#2ec7c9\"\n",
       "            ],\n",
       "            \"shape\": \"circle\",\n",
       "            \"backgroundStyle\": {},\n",
       "            \"outline\": {\n",
       "                \"show\": true,\n",
       "                \"borderDistance\": 8\n",
       "            },\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"inside\",\n",
       "                \"margin\": 8,\n",
       "                \"fontSize\": 50,\n",
       "                \"formatter\": function (param) {                    return (Math.floor(param.value * 10000) / 100) + '%';                }\n",
       "            },\n",
       "            \"center\": [\n",
       "                \"25%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"xAxisIndex\": 1,\n",
       "            \"yAxisIndex\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {}\n",
       "        },\n",
       "        {\n",
       "            \"data\": [],\n",
       "            \"selected\": {}\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"grid\": [\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        },\n",
       "        {\n",
       "            \"show\": false,\n",
       "            \"zlevel\": 0,\n",
       "            \"z\": 2,\n",
       "            \"containLabel\": false,\n",
       "            \"backgroundColor\": \"transparent\",\n",
       "            \"borderColor\": \"#ccc\",\n",
       "            \"borderWidth\": 1\n",
       "        }\n",
       "    ],\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        },\n",
       "        {\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_2b1cf1b83f99463e882d327c49d97a51.setOption(option_2b1cf1b83f99463e882d327c49d97a51);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0x1aae563c1d0>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "l1 = (\n",
    "    ch.Liquid()\n",
    "    .add(\"lq\", [0.7898], center=[\"60%\", \"50%\"],color=[\"#2ec7c9\"],\n",
    "        label_opts=opts.LabelOpts(\n",
    "        font_size=50,\n",
    "        formatter=JsCode(\n",
    "            \"\"\"function (param) {\n",
    "                    return (Math.floor(param.value * 10000) / 100) + '%';\n",
    "                }\"\"\"\n",
    "        ),\n",
    "        position=\"inside\",\n",
    "    ))\n",
    ")\n",
    "\n",
    "l2 = ch.Liquid().add(\n",
    "    \"lq\",\n",
    "    [0.0425],color=[\"#2ec7c9\"],\n",
    "    center=[\"25%\", \"50%\"],\n",
    "    label_opts=opts.LabelOpts(\n",
    "        font_size=50,\n",
    "        formatter=JsCode(\n",
    "            \"\"\"function (param) {\n",
    "                    return (Math.floor(param.value * 10000) / 100) + '%';\n",
    "                }\"\"\"\n",
    "        ),\n",
    "        position=\"inside\",\n",
    "    ),\n",
    ")\n",
    "\n",
    "grid = ch.Grid().add(l1, grid_opts=opts.GridOpts()).add(l2, grid_opts=opts.GridOpts())\n",
    "grid.render_notebook()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {
    "height": "calc(100% - 180px)",
    "left": "10px",
    "top": "150px",
    "width": "384px"
   },
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
